//
//  RDeliveyDataReporter.h
//  RDelivery
//
//  Created by selmerzhang on 2021/9/2.
//  Copyright © 2021 Tencent. All rights reserved.
//

#ifndef RDeliveyDataReporter_h
#define RDeliveyDataReporter_h

#import "NSError+RDelivery.h"

@class RDeliverySDKSettings, RDeliveryPullConfigTask;

@interface RDeliveyDataReporter : NSObject

/// 请求上报采样率的分母，10代表十分之一抽样上报
@property(readwrite, assign) NSInteger samplePercent;

/// 配置变更生效上报标记位：默认false：不上报（后期大部分情况要求不上报）；true,
@property (nonatomic, assign) BOOL isCfgChangeReport;

/// 初始化上报
/// @param settings sdk设置
- (instancetype)initWithSettings:(RDeliverySDKSettings *)settings;

/// SDK启动上报
/// @param cost 启动时间
/// @param result 启动是否成功
/// @param errorMsg 错误信息
- (void)reportStartupTimeCost:(NSUInteger)cost startupResult:(NSString *)result errorMsg:(NSString *)errorMsg;

/// 拉取远程配置上报
/// @param task 请求信息
/// @param result 结果 0成功，1失败
/// @param errorType 错误类型
/// @param httpStatusCode 错误码，没有细分则填0
/// @param errorMsg 错误信息
- (NSDictionary *)reportGetConfig:(RDeliveryPullConfigTask *)task
                           result:(NSString *)result
                        errorType:(RDeliveryErrorCode)errorType
                       statusCode:(int64_t)httpStatusCode
                         errorMsg:(NSString *)errorMsg;

/// 配置本地请求上报
/// @param targetType 请求信息
/// @param result 结果 0成功，1失败
/// @param errorMsg 错误类型
/// @param cost 错误信息
- (void)reportGetLocalConfigTargetType:(UInt64)targetType
                                result:(NSString *)result
                              errorMsg:(NSString *)errorMsg
                                  cost:(int64_t)cost;

/// 配置生效人数上报
/// @param reportInfo 上报信息
- (void)reportConfigUserCount:(NSString *)reportInfo;


@end



#endif /* RDeliveyDataReporter_h */
